package org.vectrics.recruiter.struts.tag;

import org.apache.log4j.Logger;
import org.vectrics.company.Company;
import org.vectrics.recruiter.company.RecruitCompanyInfo;
import org.vectrics.recruiter.company.RecruitCompanyService;

/**
 * @author mmoore
 */
public class RecruitCompanyViewInfoTag extends CompanyViewTag {

	private static final long serialVersionUID = 4393644159590693532L;
	
	private Logger log = Logger.getLogger(this.getClass());
    
	/**
     * 
     */
    public RecruitCompanyViewInfoTag() {
        super();
    }

    protected void addExtendedInformation(Company company) {
    	RecruitCompanyInfo info = RecruitCompanyService.getInstance().findRecruitCompanyInfo(company);
    	if (info != null) {
    		log.debug("Found recruit company info, displaying background");
    		this.addFieldRow(this.getPhrase("prompt.company.background"), info.getJobPostCompanyInfo());
    	} else {
    		log.debug("Did not find recruit company info");
    		this.addFieldRow(this.getPhrase("prompt.company.background"), this.getPhrase("phrase.not.given"));
    	}
    }
    
}
